﻿<?php
$m0in = array('示例请求|http://smartdzu.sinaapp.com/dzu/weixin/api.php?sign=520be540d627547e05bf5ecb52b7651a&module=login&xh=201211006088&sfzh=123456789','API地址|http://smartdzu.sinaapp.com/dzu/weixin/api.php?','签名|sign=520be540d627547e05bf5ecb52b7651a','调用模块|module=login','模块所需参数|xh=201211008001&sfzh=123456789','说明|sign在每次调用都是必须的,具体算法请看认证章节。');
$m1in = array('module|key');
$m2in = array('module|login','xh|学号','sfzh|身份证号或教务系统密码');
$m3in = array('module|stuinfo','xh|学生学号');
$m4in = array('module|curriculum','xh|12位学号','xn|学年，例如2014-2015','xq|学期，上学期为1，下学期为2');
$m5in = array('module|exam','xh|12位学号');
$m6in = array('module|score','xh|12位学号','xn|学年，例如2014-2015','xq|学期，上学期为1，下学期为2');
$m7in = array('module|news');
$m8in = array('module|student','xkkh|选课课号');
$m9in = array('module|xymc');
$m10in = array('module|zymc','xymc|学院名称');
$m11in = array('module|xzbmc','zymc|专业名称');
$m12in = array('module|student2','xzbmc|行政班名称');
$m13in = array('module|xykc','xymc|学院名称');
$m14in = array('module|xykcxx','xymc|学院名称','kcmc|课程名称','jsxm|教师姓名');
$m15in = array('module|jscx','skdd|上课地点，如：09-2001','sksj1|上课时间，周一 至 周天','sksj2|上课时间，1,2节或3,4节这种格式');
$m16in = array('module|library_jccx','kh|0+校园卡号');
$m17in = array('module|library_ghcx','kh|0+校园卡号');
$m18in = array('module|library_zmcx','kh|0+校园卡号');
$m19in = array('module|library_sscx','txtTm|搜索关键字');
$m20in = array('module|library_xj','id|图书控制号');

$mout = array('。。。|json数组，暂无说明');
$m0out = array('。。。|json数组，请参照以下具体说明');
$m1out = array('key|32位key值（用于生成签名，校验请求合法性）<br />Sign生成算法：sign=MD5（key+密钥）');
$m2out = array('DQSZJ|年级','XZH|学制','BYRQ|毕业日期','XSSJ|手机号','MZ|民族','XY|学院名称','XZB|行政班','YHKH|银行卡号','MM|教务系统密码(已加密)','RXRQ|入学日期','XH|学号','XI|系别','CSRQ|出生日期','ZZMM|政治面貌','XM|姓名','ZYMC|专业名称','XB|性别','XSLB|学生类别','RXZF|入学分数','XYKH|校园卡号','XXXS|性质','CC|层次','SFZH|身份证号','JG|籍贯');
$m3out = $m2out;
$m4out = array('JSXM|教师姓名','SKDD|上课地点(多个用;分开)','XQ|学期','KKXY|开课学院','XN|学年','KCMC|课程名称','KHFS|考核方式','ZYMC|专业名称','KCLB|课程类别','BJMC|班级名称','XKKH|选课课号','SKSJ|上课时间(多个用;分开)','XF|学分','KCXZ|课程性质','KCDM|课程代码');
$m5out = array('RS|考试人数','NJ|年级','JSID|教室编号','SJ|考试时间','XYMC|学院名称','LNAME|楼名称','KCMC|课程名称','ZYMC|专业名称');
$m6out = array('XQ|学期','CXCJ|重修成绩','SYCJ|实验成绩','XN|学年','KCGS|课程归属','BZ|备注','KCMC|课程名称','QZCJ|期中成绩','QMCJ|期末成绩','PSCJ|平时成绩','XKKH|选课课号','CJLSB|是否已提交(提交后为正式成绩，no为已经提交)','XF|学分','KCXZ|课程性质','JD|绩点(用于判断是否及格，0为不及格)','BKCJ|补考成绩','ECJ|成绩');
$m7out = array('。。。|暂无结果');
$m8out = array('DQSZJ|年级','XB|性别','XY|学院名称','SFZH|身份证号','XH|学号','ZYMC|专业名称','XM|姓名');
$m9out = array('XYMC|学院名称');
$m10out = array('ZYMC|专业名称');
$m11out = array('XZBMC|行政班名称');
$m12out =$m8out;
$m13out = array('JSXM|教师姓名','KCXZ|课程性质','KCMC|课程名称');
$m14out = array('JSXM|教师姓名','SKDD|上课地点(多个用;分开)','XQ|学期','KKXY|开课学院','XN|学年','KCMC|课程名称','KHFS|考核方式','ZYMC|专业名称','KCLB|课程类别','BJMC|班级名称','XKKH|选课课号','SKSJ|上课时间(多个用;分开)','XF|学分','KCXZ|课程性质');
$m15out = array('|');
$m16out = array('FPDZ|分配地址','TXM|条形码','KZH|控制号','GHSJ|归还时间','JCSJ|借出时间','MC|名称','XJCS|续借次数');
$m17out = $m16out;
$m18out = array('KM|科目','RQ|日期','JE|金额','XH|序号');
$m19out = array('|');
$m20out = array('结果|续借结果');
$m = array('简单示例','认证','登录(身份验证)','学生信息','学生课表信息','考试信息','成绩',
	'校内新闻','选择某课程的学生','学院名称','专业名称','行政班名称','某行政班的学生列表',
	'学院课程','课程信息','教室课程信息','图书借阅信息','图书归还信息','图书账目信息'
	,'图书搜索','图书续借');
$in = array($m0in,$m1in,$m2in,$m3in,$m4in,$m5in,$m6in,$m7in,$m8in,$m9in,$m10in,$m11in,$m12in,$m13in,$m14in,$m15in,$m16in,$m17in,$m18in,$m19in,$m20in);
$out = array($m0out,$m1out,$m2out,$m3out,$m4out,$m5out,$m6out,$m7out,$m8out,$m9out,$m10out,$m11out,$m12out,$m13out,$m14out,$m15out,$m16out,$m17out,$m18out,$m19out,$m20out);

//======================================================================
function getTable($title,$th1,$th2,$body){
	$t='';
	$t.='<div class="title1">';
	$t.=$title;
	$t.='</div>';
	$t.='<div class="table">';
	$t.='<table  class="gridtable" width="100%">';
	$t.='<tr>';
	$t.='<th width="100px">'.$th1.'</th>';
	$t.='<th>'.$th2.'</th>';
	$t.='</tr>';
	for ($i=0; $i < count($body); $i++) { 
		$x=explode('|', $body[$i]);
		$t.='<tr>';
		$t.='<td><center>'.$x[0].'</center></td>';
		$t.='<td>'.$x[1].'</td>';
		$t.='</tr>';
	}
	$t.='</table>';
	$t.='</div>';
	return $t;
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<style>
html{font-size: 15px; font-family: "微软雅黑";}
div{border-color: #000; border-width: 0px; border-style: solid;}
hr{width: 80%;color: #888;}
.list{margin: 0 auto; width: 80%;}
.title{text-align: center; font-size: 24px; background-color: #60AABF; color: #FAFAA0; }
.title a{ color: #FAFAA0;text-decoration: none;}
.title1{text-align: center; font-size: 20px; background-color: #bcbcbc; }
table.gridtable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #666666;border-collapse: collapse;}
table.gridtable th {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;}
table.gridtable td {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;}

#fl_menu{position:absolute;top:50px;left:0px;z-index:9999;width:150px;height:50px;}
#fl_menu .label{padding-left:20px;line-height:50px;font-size:14px;font-weight:bold;background:#000;color:#fff;letter-spacing:7px;}
#fl_menu .menu{display:none;}
#fl_menu .menu .menu_item{display:block;background:#000;color:#bbb;border-top:1px solid #333;padding:10px 20px;font-size:12px;text-decoration:none;}
#fl_menu .menu a.menu_item:hover{background:#333;color:#fff;}
</style>
<script type="text/javascript" src="web/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="web/js/jquery.easing.1.3.js"></script>
<script type="text/javascript">
function FloatMenu(){
	var animationSpeed=1500;
	var animationEasing='easeOutQuint';
	var scrollAmount=$(document).scrollTop();
	var newPosition=menuPosition+scrollAmount;
	if($(window).height()<$('#fl_menu').height()+$('#fl_menu .menu').height()){
		$('#fl_menu').css('top',menuPosition);
	} else {
		$('#fl_menu').stop().animate({top: newPosition}, animationSpeed, animationEasing);
	}
}
$(window).load(function(){
	menuPosition=$('#fl_menu').position().top;
	FloatMenu();
});
$(window).scroll(function(){ 
	FloatMenu();
});
$(document).ready(function(){
	var fadeSpeed=500;
	$("#fl_menu").hover(function(){
		$('#fl_menu .label').fadeTo(fadeSpeed, 1);
		$("#fl_menu .menu").fadeIn(fadeSpeed);
	},function(){
		$('#fl_menu .label').fadeTo(fadeSpeed, 0.75);
		$("#fl_menu .menu").fadeOut(fadeSpeed);
	});
	//======================
	$('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({
                    scrollTop: targetOffset
                },
                1000);
                return false;
            }
        }
    });
});
</script>

<title>API文档</title>
</head>
<body>
<div id="fl_menu">
<div class="label">快速导航</div>
<div class="menu">
<?php
for ($i=0; $i < count($m); $i++) { 
	echo '<a href="#aaa'.$i.'" class="menu_item">'.$m[$i].'</a>';
}
?>
</div>
</div>

	<center><h2>智能德院API说明文档</h2><center>
<?php 
for ($i=0; $i < count($m); $i++) { 
	$t.='<br /><hr /><br /><div class="list">';
	$t.='<div class="title">';
	$t.='<a name="aaa'.$i.'">'.($i+1).'、'.$m[$i].'</a>';
	$t.='</div>';
	$t.='<div class="content">';
	$t.=getTable('输入','参数名称','取值说明',$in[$i]);
	$t.=getTable('返回','参数名称','取值说明',$out[$i]);
	$t.='</div>';
	$t.='</div>';
}
echo $t;
?>
<br /><hr /><br />
<center>Power By SmartDZU</center>
</body>
</html>